Skip to content

fix(FOUR-34432): server error when completing a request - #9171

Open
rodriquelca wants to merge 1 commit into
developfrom
bugfix/FOUR-34432
Open

rodriquelca wants to merge 1 commit into
developfrom
bugfix/FOUR-34432

Conversation

@rodriquelca

@rodriquelca rodriquelca commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Issue & Reproduction Steps

TokenPersistenceRawRepository called json_encode() on data, token_properties, and self_service_groups from getAttributes(). Eloquent’s array cast already stores JSON strings there, so values were double-encoded and read back as strings instead of arrays.

Solution

  • Remove extra json_encode in serializeColumnValue; only format Carbon for raw SQL.
  • Keep json_encode in persistInstanceUpdated where the payload is a PHP array.
  • Add unit tests for JSON columns on activate / complete / close / instance update.
completed_request_issue.mov

How to Test

  1. Setup: Set TOKEN_PERSISTENCE_RAW_ENABLED=true in .env, then reload config (e.g. php artisan config:clear if you use config cache).

  2. Complete a task with form data

  3. Start a process with a form, fill fields, submit/complete the task.

  4. Re-open the task or request summary: field values should display normally (not empty or garbled).

  5. Request data after steps

  6. Run a multi-step process; complete at least one task.

  7. Open the request: variables from earlier steps should still be there for later tasks/screens.

  8. Self-service (optional)

  9. Run a self-service task that sets groups/users.

  10. Confirm it appears in the right inbox/pool and can be claimed without errors.

Unit test
./vendor/bin/phpunit tests/unit/ProcessMaker/Repositories/TokenPersistenceRawRepositoryTest.php

Related Tickets & Packages

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.

@pmPaulis pmPaulis assigned gproly and rodriquelca and unassigned gproly Nov 16, 2026
@decisions-sonarqube

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants